<template>
  <el-dialog :title="`${form.outsideQuesId ? '修改' : '添加'}测区外问题`" :visible.sync="show" :close-on-click-modal="false" :show-close="!btnLoading" width="600px" append-to-body @closed="$refs.form.resetFields()">
    <el-form ref="form" :model="form" :rules="rules">
      <el-form-item prop="outsideQuesId" class="hide" />
      <el-form-item prop="taskId" class="hide" />
      <el-form-item label="问题描述" prop="outsideDesc"><el-input v-model.trim="form.outsideDesc" type="textarea" :rows="3" placeholder="请输入问题描述" :maxlength="300" /></el-form-item>
      <el-form-item label="问题部位" prop="outsidePostion"><el-input v-model.trim="form.outsidePostion" type="textarea" :rows="3" placeholder="请输入问题部位" :maxlength="200" /></el-form-item>
    </el-form>
    <div slot="footer">
      <el-button type="primary" :loading="btnLoading" @click="btnSubmit">确 定</el-button>
      <el-button :disabled="btnLoading" @click="show = false">取 消</el-button>
    </div>
  </el-dialog>
</template>
<script>
// 添加或修改测区外问题
import { editFormMixin } from '@/utils/mixin'
import { addOutsideQues, updateOutsideQues } from '@/api/qualityManage/cq'
export default {
  mixins: [editFormMixin],
  data() {
    return {
      primaryKey: 'outsideQuesId',
      addApi: addOutsideQues,
      updateApi: updateOutsideQues,
      form: {
        outsideQuesId: '',
        taskId: '',
        outsideDesc: '',
        outsidePostion: ''
        // status: 0
      },
      rules: {
        outsideDesc: [{ required: true, message: '请输入问题描述' }],
        outsidePostion: [{ required: true, message: '请输入问题部位' }]
      }
    }
  }
}
</script>
